<div class="spacing-bottom-sm" page-header="Manage certificate">
    <div class="row">
        <div class="col-sm-4" ng-show="checkHideCustomer()">
            <input class="form-control" ng-model="customer" placeholder="Customer" ui-keypress="{13:'search(customer)'}" 
                   typeahead-on-select="updateCustomer($item)" typeahead="customer as customer.name for customer in getCustomerList($viewValue)" />
        </div>
        <div class="col-sm-2">
            <input class="form-control" ng-model="filters.serialNo" placeholder="Serial #" type="text" ui-keypress="{13:'search()'}" autofocus />
        </div>
        <div class="col-sm-2">
            <input class="form-control" ng-model="filters.certificateNo" placeholder="Certificate #" type="text" ui-keypress="{13:'search()'}" />
        </div>
        <div class="col-sm-2">
            <input class="form-control" ng-model="filters.modelNo" placeholder="Model #" type="text" ui-keypress="{13:'search()'}" />
        </div>
        <div class="col-sm-2">
            <a class="btn btn-info" ui-sref="certificate-new">
                <b class="glyphicon glyphicon-plus"></b> New certificate
            </a>
        </div>
    </div>
</div>

<table ng-table="tableParams" class="table table-hover table-bordered ng-table-resizable-columns" ng-visible="$data.length">
    <tr ng-repeat=" transaction in $data">
        <td data-title="'Report #'" header-class="width5" style="min-width: 120px;"><span class="form-control-static">{{transaction.certificateNo}}</span></td>
        <td data-title="'Customer'" header-class="col-sm-3 width30"><span class="form-control-static">{{transaction.name}}</span></td>
        <td data-title="'Description'" header-class="col-sm-3"><span class="form-control-static">{{transaction.description}}</span></td>
        <td data-title="'Manufacturer'" header-class="col-sm-2 width10"><span class="form-control-static">{{transaction.manufacturer}}</span></td>
        <td data-title="'Serial #'" header-class="col-sm-1 width10"><span class="form-control-static">{{transaction.serialNumber}}</span></td>
        <td data-title="'Calib date'" header-class="col-sm-1 width7"><span class="form-control-static">{{transaction.calibrationDate | date: 'dd/MMM/yyyy'}}</span></td>
        <td class="text-center" header-class="col-sm-1 width5">
            <a ui-sref="certificate-item({id: transaction.id})" class="btn btn-default">View</a>
        </td>
    </tr>
</table>
<div ng-show="!tableParams.settings().$loading && tableParams.data.length === 0" class="well text-center">No result</div>